// 导入路由中的方法
// createRouter：创建路由实例 -> vue2中 new Router([])
// createWebHistory: 创建history模式的路由
import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "home",
      redirect: "/big-screen",
    },
    {
      path: "/big-screen",
      name: "big-screen",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      // 懒加载
      component: () => import("../views/BigScreen.vue"),
    },
  ],
});

export default router;
